#!/usr/bin/env python

import unittest
import nmea2k

class TestNMEA2K(unittest.TestCase):
    '''Tests data inputs for nmea2k module'''

    def setUp(self):
        print('setting up data')
        self.data = ['0C 00 22 33 44 AA BB CC DD 00 11 22 33',
                     '08 00 11 22 33 EE FF AA BB']
        self.n2k = nmea2k.NMEA2K()

    def test_data(self):
        '''test_data function'''

        print(self.test_data.__doc__)
        for s in self.data:
            print('processing "{0}"'.format(s))
            res = self.n2k.process_received_str(s)
            print(res)
            self.assertEqual(res['status'],'processed')



if __name__ == '__main__':
    print(TestNMEA2K.__doc__)
    unittest.main()
